package secretaryGUI;

import java.awt.Color;
import java.sql.SQLException;

import javax.swing.JLabel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;

import com.sun.rowset.CachedRowSetImpl;
import flexibility.CachedRowSetTableModel;
import guiCode.secretaryScreenCode;

public class updateUpperTableEntries {

	
	secretaryAlerts sa = new secretaryAlerts();
	private CachedRowSetTableModel data; 
	private secretaryScreenCode ssc;
	
	public void update(createSecretaryWindow csw, CachedRowSetImpl crs ){
		
		try {
			// if(ssc.getSemesterForEdit()==1){
			csw.table.setModel(data = new CachedRowSetTableModel(crs));
			DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
			centerRenderer.setHorizontalAlignment(JLabel.CENTER);
			for (int i = 0; i < csw.table.getColumnCount(); i++)
				csw.table.getColumnModel().getColumn(i)
						.setCellRenderer(centerRenderer);

			//csw.table.setEnabled(false);

			// }
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
